package day7.zy3;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入网址");
        String a = in.next();
        try {
            System.out.println(InetAddress.getLocalHost());
            InetAddress []s= InetAddress.getAllByName(a);
            for (InetAddress x:s) {
                System.out.println(x);
            }

        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
